package com.lingkang.dbtodoc.dto;

import java.io.Serializable;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author 绫小路
 * @date 2021/1/31 23:56
 * @description
 */
@Data
@Accessors(chain = true)
public class ResponseResult<T> implements Serializable {

  private int code;
  private String msg;
  private T data;

  public ResponseResult() {
    this.code = 1;
  }

  public ResponseResult(T data) {
    code = 0;
    this.data = data;
  }

  public ResponseResult(int code) {
    this.code = code;
  }

  public ResponseResult(int code, String msg) {
    this.code = code;
    this.msg = msg;
  }

  public ResponseResult(int code, T data) {
    this.code = code;
    this.data = data;
  }

  public ResponseResult(int code, String msg, T data) {
    this.code = code;
    this.msg = msg;
    this.data = data;
  }
}
